{include file="public/account_head"}
<div id="vmsupplyItem">
    <div class="pub_wid notice_cont">
        <div class="mes_left rg">
            <div class="message bgb widthauto radius">
                <h6>我的发布</h6>
                <div class="order_details">

                    <a @click="openPopups" class="rel_but butt">发布</a>
                    <ul>
                        <li class="fortab prepaids5 checked">全部</li>
                        <li class="fortab prepaids6">
                            <select>
                                <option>所属类别</option>
                            </select>
                        </li>
                        <li class="fortab prepaids7">
                            <select>
                                <option>审核状态</option>
                            </select>
                        </li>
                    </ul>
                    <a href="#" class="rel_so butt">搜索</a> </div>
                <div>
                    <div class="tablelist showdomdiv showsss" >
                        <div class="bgb member_box">
                            <div class="table_head widthauto"><span class="five">ID</span><span class="nine">所属分类</span><span class="second">标题</span><span class="nine">服务类型</span><span class="nine">货物类别</span><span class="nine">地区</span><span class="nine">金额</span><span class="nine">发布时间</span><span class="nine">审核状态</span><span class="seventh">操作</span></div>
                            <ul class="widthauto middl_ul">
                                <li v-for="(item,index) in itemDataList">
                                    <span class="five">{{(((current_page-1)*num)+index)+1}}</span>
                                    <span class="nine">{{item_category_status[item_category-1]}}</span>
                                    <span class="second">{{item.title}}</span>
                                    <span class="nine">{{item.service_name}}</span>
                                    <span class="nine">{{item.trade_name}}</span>
                                    <span class="nine">{{item.city}}</span>
                                    <span class="nine">{{item.budget}}万元/年</span>
                                    <span class="nine">{{item.create_time}}</span>
                                    <span class="nine ing">{{item_status[item.status-1]}}</span>
                                    <span class="seventh"><a href="#">编辑</a><a href="#">删除</a></span>
                                </li>
                                <li><span class="five">1</span><span class="nine">招标公告</span><span class="second">2021年物流运输服务项目招标公告</span><span class="nine">运输服务</span><span class="nine">食品</span><span class="nine">广州</span><span class="nine">50000元</span><span class="nine">2021-01-01</span><span class="nine">已发布</span><span class="seventh"><a href="#">报名情况</a><a href="#">提前截止</a></span></li>
                                <li><span class="five">1</span><span class="nine">招标公告</span><span class="second">2021年物流运输服务项目招标公告</span><span class="nine">运输服务</span><span class="nine">食品</span><span class="nine">广州</span><span class="nine">50000元</span><span class="nine">2021-01-01</span><span class="nine end">未通过</span><span class="seventh"><a href="#">编辑</a><a href="#">删除</a><a href="#" class="end">查看原因</a></span></li>
                                <li><span class="five">1</span><span class="nine">招标公告</span><span class="second">2021年物流运输服务项目招标公告</span><span class="nine">运输服务</span><span class="nine">食品</span><span class="nine">广州</span><span class="nine">50000元</span><span class="nine">2021-01-01</span><span class="nine grey">已截止</span><span class="seventh"><a href="#">编辑</a></span></li>
                            </ul>
                        </div>
                        <div class="widthauto pages_box">
                            <a @click="pageNumGetList(1)">首页</a>
                            <a @click="pageNextList(-1)">上一页</a>
                            <a v-for="item in pageInfo.total" @click="pageNumGetList(item)">{{item}}</a>
                            <a @click="pageNextList(1)">下一页</a>
                            <a  @click="pageNumGetList(pageInfo.total)">尾页</a>
                        </div>
                    </div>
                    <div class="tablelist hidedomdiv showsss">
                        <div class="bgb member_box">
                            <div class="table_head widthauto"><span class="five">ID</span><span class="nine">所属分类</span><span class="second">标题</span><span class="nine">服务类型</span><span class="nine">货物类别</span><span class="nine">地区</span><span class="nine">金额</span><span class="nine">发布时间</span><span class="nine">审核状态</span><span class="seventh">操作</span></div>
                            <ul class="widthauto middl_ul">
                                <li><span class="five">1</span><span class="nine">招标公告</span><span class="second">2021年物流运输服务项目招标公告</span><span class="nine">运输服务</span><span class="nine">食品</span><span class="nine">广州</span><span class="nine">50000元</span><span class="nine">2021-01-01</span><span class="nine ing">待审核</span><span class="seventh"><a href="#">编辑</a><a href="#">删除</a></span></li>
                                <li><span class="five">1</span><span class="nine">招标公告</span><span class="second">2021年物流运输服务项目招标公告</span><span class="nine">运输服务</span><span class="nine">食品</span><span class="nine">广州</span><span class="nine">50000元</span><span class="nine">2021-01-01</span><span class="nine">已发布</span><span class="seventh"><a href="#">报名情况</a><a href="#">提前截止</a></span></li>
                                <li><span class="five">1</span><span class="nine">招标公告</span><span class="second">2021年物流运输服务项目招标公告</span><span class="nine">运输服务</span><span class="nine">食品</span><span class="nine">广州</span><span class="nine">50000元</span><span class="nine">2021-01-01</span><span class="nine end">未通过</span><span class="seventh"><a href="#">编辑</a><a href="#">删除</a><a href="#" class="end">查看原因</a></span></li>
                            </ul>
                        </div>
                        <div class="widthauto pages_box"> <a href="#">首页</a><a href="#">上一页</a><a href="#">1</a><a href="#">2</a><a href="#">3</a><a href="#">...</a><a href="#">下一页</a><a href="#">尾页</a> </div>
                    </div>
                    <div class="tablelist hidedomdiv showsss">
                        <div class="bgb member_box">
                            <div class="table_head widthauto"><span class="five">ID</span><span class="nine">所属分类</span><span class="second">标题</span><span class="nine">服务类型</span><span class="nine">货物类别</span><span class="nine">地区</span><span class="nine">金额</span><span class="nine">发布时间</span><span class="nine">审核状态</span><span class="seventh">操作</span></div>
                            <ul class="widthauto middl_ul">
                                <li><span class="five">1</span><span class="nine">招标公告</span><span class="second">2021年物流运输服务项目招标公告</span><span class="nine">运输服务</span><span class="nine">食品</span><span class="nine">广州</span><span class="nine">50000元</span><span class="nine">2021-01-01</span><span class="nine">已发布</span><span class="seventh"><a href="#">报名情况</a><a href="#">提前截止</a></span></li>
                                <li><span class="five">1</span><span class="nine">招标公告</span><span class="second">2021年物流运输服务项目招标公告</span><span class="nine">运输服务</span><span class="nine">食品</span><span class="nine">广州</span><span class="nine">50000元</span><span class="nine">2021-01-01</span><span class="nine end">未通过</span><span class="seventh"><a href="#">编辑</a><a href="#">删除</a><a href="#" class="end">查看原因</a></span></li>
                                <li><span class="five">1</span><span class="nine">招标公告</span><span class="second">2021年物流运输服务项目招标公告</span><span class="nine">运输服务</span><span class="nine">食品</span><span class="nine">广州</span><span class="nine">50000元</span><span class="nine">2021-01-01</span><span class="nine grey">已截止</span><span class="seventh"><a href="#">编辑</a></span></li>
                            </ul>
                        </div>
                        <div class="widthauto pages_box"> <a href="#">首页</a><a href="#">上一页</a><a href="#">1</a><a href="#">2</a><a href="#">3</a><a href="#">...</a><a href="#">下一页</a><a href="#">尾页</a> </div>
                    </div>
                    <div class="tablelist hidedomdiv showsss" >
                        <div class="bgb member_box">
                            <div class="table_head widthauto"><span class="sma">ID</span><span class="name">公司名称</span><span class="sma">状态</span><span class="oper">操作</span> </div>
                            <ul class="widthauto middl_ul">
                                <li><span class="sma">1</span><span class="name">浙江新天力容器科技有限公司</span> <span class="sma ok">已通过</span><span class="oper"><a href="#" class="one">查看企业详情资料</a></span></li>
                                <li><span class="sma">2</span><span class="name">浙江新天力容器科技有限公司</span> <span class="sma ok">已通过</span><span class="oper"><a href="#" class="one">查看企业详情资料</a></span></li>
                                <li><span class="sma">3</span><span class="name">浙江新天力容器科技有限公司</span> <span class="sma ok">已通过</span><span class="oper"><a href="#" class="one">查看企业详情资料</a></span></li>
                            </ul>
                        </div>
                        <div class="widthauto pages_box"> <a href="#">首页</a><a href="#">上一页</a><a href="#">1</a><a href="#">2</a><a href="#">3</a><a href="#">...</a><a href="#">下一页</a><a href="#">尾页</a> </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="lf two_left">
            <div class="about_nav">
                <ul class="widthauto">
                    <li><a href="#" class="down">账户中心</a></li>
                    <p class="widthauto"><a href="#">我的信息</a><a href="#">修改密码</a></p>
                    <li><a href="#">运力服务商</a></li>
                    <li><a href="#" class="cur">我的发布</a></li>
                </ul>
            </div>
            <div class="add_box"> <a href="#"><img src="/static/index/public/images/add_008.jpg" /></a> </div>
        </div>
    </div>

    <div v-if="shadeStatus"  class="maska"></div>
    <div v-if="popupsStatus" class="release rgb">
        <div class="message bgb widthauto radius">
            <h6>发布<a><img @click="closePopups" src="/static/index/public/images/tips_close.png" /></a></h6>
            <ul class="att_box widthauto">
                <li><span>所属分类：</span>
                    <a :class="{'cur':item_category==1}" @click="changeItemCategory(1)" class="choose">招标公告</a>
                    <a :class="{'cur':item_category==2}" @click="changeItemCategory(2)" class="choose">实时货源</a> </li>
                <li><span>标题：</span>
                    <input v-model="itemData.title" name="" type="text"  class="bai" placeholder="请输入标题"/>
                </li>
                <li><span>服务类别：</span>
                    <select v-model="itemData.service_name" class="five">
                        <option value="">选择类别</option>
                        <option v-for="item in serviceList" :value="item.name">{{item.name}}</option>
                    </select>
                </li>
                <li><span>货物类别：</span>
                    <select v-model="itemData.trade_name" class="five">
                        <option value="">选择类别</option>
                        <option v-for="item in tradeList" :value="item.name">{{item.name}}</option>
                    </select>
                </li>
                <li id="distpicker"><span>地区：</span>
                    <select v-model="itemData.province" class="five">
                        <option>请选择省</option>
                    </select>
                    <select v-model="itemData.city" class="five">
                        <option>请选择城市</option>
                    </select>

                </li>
<!--                <li><span>报名截止日期：</span>-->
<!--                    <select class="five">-->
<!--                        <option>请选择</option>-->
<!--                    </select>-->
<!--                </li>-->
                <li><span>投标截止日期：</span>
                    <input v-model="itemData.end_time" id="end_time" name="" type="text" class="five" placeholder="请选择截止日期"/>
                </li>
                <li><span>预算金额：</span>
                    <input v-model="itemData.budget" name="" type="text" class="five" placeholder="请输入金额"/>
                    万元/年</li>
                <li><span>项目概况：</span>
                    <textarea v-model="itemData.item_about" name="" cols="" rows="" placeholder="请输入内容"></textarea>
                </li>
                <li><span>资格要求：</span>
                    <textarea v-model="itemData.certification_content" name="" cols="" rows="" placeholder="请输入内容"></textarea>
                </li>
                <li><span>项目内容：</span>
                    <textarea v-model="itemData.item_content" name="" cols="" rows="" placeholder="请输入内容"></textarea>
                </li>
                <li><span>附件：</span><a href="#" class="add">点击添加</a>
                </li>
                <li class="reup"><span>&nbsp;</span><input name="" type="text"  class="wuba" placeholder="请输入标题"/><img class="file" src="/static/index/public/images/uploaded.png" />
                    <div class="fileInput left">
                        <input type="file" name="upfile" id="upfile1" class="upfile" onchange="document.getElementById('upfileResult').innerHTML=this.value"/>
                        <input class="upFileBtn" type="button" onclick="document.getElementById('upfile').click()" />
                    </div>
                </li>
                <li class="up"><span>&nbsp;</span><input name="" type="text"  class="wuba" placeholder="请输入标题"/><img class="file" src="/static/index/public/images/uploadago.png" />
                    <div class="fileInput left">
                        <input type="file" name="upfile" id="upfile" class="upfile" onchange="document.getElementById('upfileResult').innerHTML=this.value"/>
                        <input class="upFileBtn" type="button" onclick="document.getElementById('upfile').click()" />
                    </div>
                </li>
            </ul>
            <div class="submit"><a @click="addNoticeItem()">提交审核</a></div>
        </div>
    </div>
</div>
    {include file="public/footer"}
<!--全国省份-->
<script src="/static/util/distpicker/distpicker.min.js"></script>
<!--时间组件-->
<script src="/static/util/laydate/laydate.js"></script>
<script type="text/javascript">
    var vmsupplyItem = new Vue({
        el:"#vmsupplyItem",
        data:{
            shadeStatus:false,
            popupsStatus:false,
            serviceList:[],//服务类型列表
            tradeList:[],//商品类别
            item_category:1,//发布类别，1.招标公告，2.实时货源
            itemData:{

            },
            end_time:'',
            member_id:'',
        },
        methods:{
            changeItemCategory:function(num){
                this.item_category = num
            },
            openPopups:function () {
                var el = this
                el.shadeStatus = true
                el.popupsStatus = true
                setTimeout(()=>{
                    $('#distpicker').distpicker();
                    laydate.render({
                        elem: '#end_time', //指定元素
                        done: function (value,date,endDate) {
                            el.itemData.end_time =value
                        }
                    });
                    },200)


            },
            closePopups:function () {
                this.shadeStatus = false
                this.popupsStatus = false
            },
            getTradeChildList:function(){
                var el = this
                AjaxPost({"trade_id":2},'/index/trade/getTradeChildByWhere').then((response=>{
                    el.serviceList = response.result
                }))
                AjaxPost({"trade_id":1},'/index/trade/getTradeChildByWhere').then((response=>{
                    el.tradeList = response.result
                }))
            },
            addNoticeItem:function () {
                var el = this
                if(el.member_id == ''){
                    $.customToastr('error','未查询到会员信息，请重新登录')
                    return
                }
                var postDate = {
                    ...el.itemData,
                    'item_category':el.item_category,
                    'member_id':el.member_id
                }
                AjaxPost({"postDate":postDate},'/index/consignor/addNoticeItem').then((response)=>{
                    if (response.status == 1){
                        this.shadeStatus = false
                        this.popupsStatus = false
                        $.customToastr('success','添加成功，请等待审核')
                    }
                    console.log(response)
                })
            },
            getNoticeItem:function () {
                
            }

        },
        mounted(){
            this.$nextTick(function () {
                this.getTradeChildList();
                if(localStorage.getItem("memberId") != null){
                    this.member_id = localStorage.getItem("memberId")
                }
                this.getNoticeItem();
            })
            $(document).ready(function(){
                // 改为鼠标移上的事件只需把click改为mousemove
                $(".fortab").click(function(){
                    var number=$(".fortab").index(this);
                    $(this).addClass("checked");
                    $(this).siblings().removeClass("checked");
                    $(".tablelist:eq("+number+")").show();
                    $(".tablelist:eq("+number+")").siblings().hide();
                });

            });
        }
    })
</script>
